/**************************************************************************************************
  Filename:       variable.h
  Revised:        $Date: 2015-9-28  $
  Revision:       $Revision: V1.1  $
  User:           $User:Asong      $
  Description:    全局变量相关

**************************************************************************************************/
#ifndef _TVARIABLE_H_
#define _TVARIABLE_H_

#ifdef __cplusplus
extern "C"
{
#endif

//#include "hal_defs.h"
#include "global.h"
  // #include "multi_button.h"
  extern uint8_t code ver[3];
  extern uint8_t xdata SetDefault;

  extern uint16_t idata templ, temph;
  extern uint8_t idata i;
  // extern uint32_t idata adc_sum;
  /******************key param****************/
  extern keyBuff_t xdata KeyBuff, KeyChangedBuff, FlagKeyPress, FlagKeyRelease, LastTimeKey;
  extern uint8_t xdata LongKeyEvt;
  extern uint8_t xdata keyCount;
  // extern uint16_t xdata prvLPCount;
  extern uint8_t xdata FF_PressCount, FF_ReleaseCount;
  extern uint8_t xdata PressPageType;
  extern uint16_t xdata LongPressTime;
  extern keyState_t xdata KeyStatus;
  extern uint8_t xdata status, KeyNum;

  /******************led param****************/

  extern uint8_t xdata hundreds, decade, unit, decimals;
  extern uint8_t xdata hi, lo;
  extern uint8_t code NumCode[10]; // 0-9 abcde
  extern uint16_t code CfgList[CfglistNum];
  // extern uint16_t code TestList[7];

  extern cfgParaRange_t code CfgParaRange[CfglistNum];
  extern cfgParaRange_t xdata st_ParaRange[3];
  extern uint8_t xdata displayCode[4];

  extern uint8_t xdata updateCount;
  extern uint8_t xdata displayState;
  extern uint16_t xdata ErrCodeList[ErrCodelistNum];
  extern uint8_t xdata ErrPage, e, ErrPageMax;
  extern uint16_t xdata tempA;

  /******************cfg param****************/
  // extern uint8_t idata PowerState;
  extern quickFrozenState_t idata QuickFrozenState;
  extern uint8_t xdata CoolingMode,L_CoolingMode;
  extern cfgPara_t xdata cfgPara[2];
  // extern cfgPara_t code def_cfgPara;
  extern cfgPara_t xdata DuplicatePara;
  extern int8_t xdata *cfg_Ptr;
  extern int8_t xdata *duplicate_sptr;
  extern int8_t xdata DuplicateData; //备用数据

  extern tPara_t idata tPara;

  extern int16_t xdata CtrTargetTemp;
  extern int16_t xdata CtrTargetTemp1;
  extern int16_t xdata CtrTargetTemp2;

  /********************NTC******************/
  extern ntcPara_t xdata ntcPara[2];
  extern uint16_t xdata NTC_ADValue;
  extern int32_t xdata NTC_ADValue_Sum;

  extern int16_t xdata TempInside;
  extern int16_t xdata DiffTemp;
  extern int16_t xdata DisplayTemp;
  extern int16_t xdata TargetTemp;
  extern uint16_t xdata offsetTemp;
  extern int16_t xdata BeforeDefrosteTemp;

  extern int16_t idata DefrostTemp;

  extern errState_t xdata ErrorState;
  // extern alarmState_t AlarmState;

  extern flag_t xdata Flag1;
  extern flag2_t xdata Flag2;
  extern flag3_t xdata Flag3;

  // extern workState_t xdata CompWorkState;
  extern displayDot_t xdata disDotStatus;
  extern defrostState_t xdata DefrostState;

  extern tpage_MSG xdata m_PageInfor;

  extern uint8_t idata Evt_tick;
  extern uint8_t idata evt_index;

  extern uint32_t xdata CompRunMaxTime;
  extern uint32_t idata FactoryMode_StopTime;

#ifdef FAN_PWM
  extern uint16_t xdata FanPwmList[3];
#endif

  extern void Variable_Init(void);

#ifdef __cplusplus
}
#endif
#endif
